//
//  ZGSBookCaseCell.m
//  MapleLeaf
//
//  Created by dllo on 15/12/5.
//  Copyright © 2015年 AntennaBabyTeam. All rights reserved.
//

#import "ZGSBookCaseCell.h"
#define WIDTHT [UIScreen mainScreen].bounds.size.width
#define HEIGHTT [UIScreen mainScreen].bounds.size.height

@implementation ZGSBookCaseCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createViews];
    }
    return self;
}



- (void)createViews {
    self.picView = [[UIImageView alloc] init];
    self.picView.layer.cornerRadius = 10;
    self.picView.layer.masksToBounds = YES;
    [self.contentView addSubview:self.picView];
    
    self.titleLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.titleLabel];
    self.titleLabel.font = [UIFont systemFontOfSize:17];
    
    self.lookNumber = [[UILabel alloc] init];
    self.lookNumber.font = [UIFont systemFontOfSize:13];
    self.lookNumber.textColor = [UIColor colorWithRed:0.690f green:0.690f blue:0.690f alpha:1.00f];
    [self.contentView addSubview:self.lookNumber];
    
    self.sumNumber = [[UILabel alloc] init];
    self.sumNumber.font = [UIFont systemFontOfSize:13];
    self.sumNumber.textColor = [UIColor colorWithRed:0.690f green:0.690f blue:0.690f alpha:1.00f];
    [self.contentView addSubview:self.sumNumber];
    
    self.readButton = [UIButton buttonWithType:UIButtonTypeSystem];
    [self.readButton setTitle:@"续看" forState:UIControlStateNormal];
    self.readButton.layer.cornerRadius = 7;
    self.readButton.backgroundColor = [UIColor colorWithRed:0.961f green:0.325f blue:0.173f alpha:1.00f];
    self.readButton.tintColor = [UIColor whiteColor];
    self.readButton.titleLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:17];
    [self.contentView addSubview:self.readButton];
    
    self.lineView = [[UIView alloc] init];
    self.lineView.layer.borderWidth = 1;
    self.lineView.layer.borderColor = [[UIColor colorWithRed:0.871f green:0.871f blue:0.871f alpha:1.00f] CGColor];
    [self.contentView addSubview:self.lineView];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    self.picView.frame = CGRectMake(12.0 * WIDTHT / 375.0, 10.0 * HEIGHTT / 667.0, 68.0 * WIDTHT / 375.0, 90.0 * HEIGHTT / 667.0);
    self.titleLabel.frame = CGRectMake(95.0 * WIDTHT / 375.0, 20.0 * HEIGHTT / 667.0, 150.0 * WIDTHT / 375.0, 20.0 * HEIGHTT / 667.0);
    self.lookNumber.frame = CGRectMake(95.0 * WIDTHT / 375.0, 55.0 * HEIGHTT / 667.0, 190.0 * WIDTHT / 375.0, 15.0 * HEIGHTT/ 667.0);
    self.sumNumber.frame = CGRectMake(95.0 * WIDTHT / 375.0, 75.0 * HEIGHTT / 667.0, 190.0 * WIDTHT / 375.0, 15.0 * HEIGHTT / 667.0);
    self.readButton.frame = CGRectMake(WIDTHT - 85.0 * WIDTHT / 375.0, 40.0 * HEIGHTT / 667.0, 70.0 * WIDTHT / 375.0, 35.0 * HEIGHTT / 667.0);
    self.lineView.frame = CGRectMake(15.0 * WIDTHT / 375.0, 108.0 * HEIGHTT / 667.0, WIDTHT- 30.0 * WIDTHT / 375.0, 1);
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
